package com.zjhb.common.enumutil;

public enum UserTypes {

	Admin("0", "管理员"),
	Base("1", "普通用户"),
	Leader("2", "首长"),
	Keep("3", "检修人员");

	private String key;
	private String value;

	private UserTypes(String key, String value) {
		this.key = key;
		this.value = value;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public static UserTypes parse(String key) {
		UserTypes [] areas=UserTypes.values();
		for(UserTypes a:areas){
			if(a.getKey().equals(key)){
				return a;
			}
		}
        return null;
	}

	public static UserTypes parseValue(String value) {
		UserTypes [] areas=UserTypes.values();
		for(UserTypes a:areas){
			if(a.getValue().equals(value)){
				return a;
			}
		}
        return null;
	}



}
